﻿<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        
        Static Dim counter As Integer = 0
        
        If Session("counter") Is Nothing Then            
            Session("counter") = 1
        End If
        
        If Page.IsPostBack = True Then
            If ScriptManager1.IsInAsyncPostBack = True Then
                '               chiamato da Ajax
                ltipo.Text = "ajax"
                                
                Session("counter") = Session("counter") + 1
                
                lnumero.Text = Session("counter").ToString
            End If
  
        Else
 
        End If
                
        
    End Sub

    </script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    
    <form id="form1" runat="server">
    
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    chiamata:  <asp:Label ID="ltipo" runat="server"></asp:Label>
    numero:  <asp:Label ID="lnumero" runat="server"></asp:Label>
    <asp:Button ID="Button1" runat="server" Text="Button" />
    
    </ContentTemplate>
    </asp:UpdatePanel>
    

    </div>
    </form>
</body>
</html>
